<?php

require_once(str_replace('\\\\','/',dirname(__FILE__)).'/../../../spider.config.php');

require_once(str_replace('\\\\','/',dirname(__FILE__)).'/../class/config.class.php');
require_once(str_replace('\\\\','/',dirname(__FILE__)).'/../class/util.class.php');

// sets physical filesystem directory of web site root
// if calculation fails (usually if web server is not apache) set this manually
SpawConfig::setStaticConfigItem('DOCUMENT_ROOT', str_replace("\\","/",SpawVars::getServerVar("DOCUMENT_ROOT")));

if (!preg_match('/\/$/', SpawConfig::getStaticConfigValue('DOCUMENT_ROOT')))
{
  SpawConfig::setStaticConfigItem('DOCUMENT_ROOT', SpawConfig::getStaticConfigValue('DOCUMENT_ROOT').'/');
}
// sets physical filesystem directory where spaw files reside
// should work fine most of the time but if it fails set SPAW_ROOT manually by providing correct path
SpawConfig::setStaticConfigItem('SPAW_ROOT', str_replace("\\","/",realpath(dirname(__FILE__)."/..").'/'));

// sets virtual path to the spaw directory on the server
// if calculation fails set this manually
SpawConfig::setStaticConfigItem('SPAW_DIR', SPIcfg::$util['spaw2']['spaw_root']);
// ------------------------------------------------------------------------------

SpawConfig::setStaticConfigItem('default_lang','ru');               // language 
SpawConfig::setStaticConfigItem('default_output_charset','');       // output charset (empty strings means charset specified in language file)
SpawConfig::setStaticConfigItem('default_theme','spaw2');           // theme 
SpawConfig::setStaticConfigItem('default_toolbarset','standard');   // toolbarset 
SpawConfig::setStaticConfigItem('default_width','100%');            // width 
SpawConfig::setStaticConfigItem('default_height','250px');          // height 
SpawConfig::setStaticConfigItem('default_stylesheet', SPIcfg::$util['spaw2']['default_css'] ); // stylesheet

// ------------------------------------------------------------------------------

SpawConfig::setStaticConfigItem('USE_ICONV',true);                                          // specifies if language subsystem should use iconv functions to convert strings to the specified charset
SpawConfig::setStaticConfigItem('rendering_mode', 'xhtml', SPAW_CFG_TRANSFER_JS);           // specifies rendering mode to use: "xhtml" - renders using spaw's engine, "builtin" - renders using browsers engine
SpawConfig::setStaticConfigItem('beautify_xhtml_output', true, SPAW_CFG_TRANSFER_JS);       // specifies that xhtml rendering engine should indent it's output
SpawConfig::setStaticConfigItem('base_href', '', SPAW_CFG_TRANSFER_JS);                     // specifies host and protocol part (like http://mydomain.com) that should be added to urls returned from file manager (and probably other places in the future) 
SpawConfig::setStaticConfigItem('strip_absolute_urls', true, SPAW_CFG_TRANSFER_JS);         // specifies if spaw should strip domain part from absolute urls (IE makes all links absolute)
SpawConfig::setStaticConfigItem('resizing_directions', 'vertical', SPAW_CFG_TRANSFER_JS);   // specifies in which directions resizing is allowed (values: none, horizontal, vertical, both)
SpawConfig::setStaticConfigItem('convert_html_entities', false, SPAW_CFG_TRANSFER_JS);      // specifies that special characters should be converted to the respective html entities

// ------------------------------------------------------------------------------

SpawConfig::setStaticConfigItem("dropdown_data_core_style",                                 // data for style (css class) dropdown list
    array( '' => 'Normal', /* 'styleID' => 'styleName' */ ) );

SpawConfig::setStaticConfigItem("table_styles",                                             // data for style (css class) dropdown in table properties dialog
    array( '' => 'Normal', /* 'styleID' => 'styleName' */ ) );

SpawConfig::setStaticConfigItem("table_cell_styles",                                        // data for style (css class) dropdown in table cell properties dialog
    array( '' => 'Normal', /* 'styleID' => 'styleName' */ ) );

SpawConfig::setStaticConfigItem("image_styles",                                             // data for style (css class) dropdown in image properties dialog
    array( '' => 'Normal', /* 'styleID' => 'styleName' */ ) );

SpawConfig::setStaticConfigItem("dropdown_data_core_fontname",                              // data for fonts dropdown list
    array( '' => 'Default', 'Courier' => 'Courier', 'Tahoma' => 'Tahoma', ) );

SpawConfig::setStaticConfigItem("dropdown_data_core_fontsize",                              // data for fontsize dropdown list
    array( '' => 'Default', '1' => '1', '2' => '2', '3' => '3', ) );

SpawConfig::setStaticConfigItem("dropdown_data_core_formatBlock",                           // data for paragraph dropdown list
    array(
        '<p>' => 'Paragraph',
        '<H1>' => 'Heading 1',
        '<H2>' => 'Heading 2',
        '<H3>' => 'Heading 3',
        '<H4>' => 'Heading 4',
        '<H5>' => 'Heading 5',
        '<H6>' => 'Heading 6',
    )
);

SpawConfig::setStaticConfigItem("a_targets",                                                // data for link targets drodown list in hyperlink dialog
    array(
        '_self' => 'Self window',
        '_blank' => 'In new window',
    #   '_top' => 'Top wid',
    #   '_parent' => 'Parent'
    )
);

SpawConfig::setStaticConfigItem("quick_links",                                              // data for quick links dropdown (new in 2.0.6)
    array( /* 'http://link' => 'Name of link' */ ), SPAW_CFG_TRANSFER_SECURE );

SpawConfig::setStaticConfigItem('toolbarset_standard',                                      // toolbar sets (should start with "toolbarset_" (standard core toolbars)
  array(
    "format" => "format",
    "style" => "style",
    "edit" => "edit",
    "table" => "table",
    "plugins" => "plugins",
    "insert" => "insert",
    "tools" => "tools"
  ) 
);

SpawConfig::setStaticConfigItem('toolbarset_mini',                                          // mini core toolbars
  array(
    "format" => "format_mini",
    "edit" => "edit",
    "tools" => "tools"
  ) 
);

SpawConfig::setStaticConfigItem('colorpicker_predefined_colors',                            // colorpicker config
    array( 'black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'aqua' ), SPAW_CFG_TRANSFER_SECURE );

// ------------------------------------------------------------------------------
// SpawFm plugin config:

// global filemanager settings
SpawConfig::setStaticConfigItem(
  'PG_SPAWFM_SETTINGS',
  array(
    'allowed_filetypes'   => array('any'),  // allowed filetypes groups/extensions
    'allow_modify'        => true,          // allow edit filenames/delete files in directory
    'allow_upload'        => true,          // allow uploading new files in directory
    //'chmod_to'          => 0777,          // change the permissions of an uploaded file if allowed
                                            // (see PHP chmod() function description for details), or comment out to leave default
    'max_upload_filesize' => 0,             // max upload file size allowed in bytes, or 0 to ignore
    'max_img_width'       => 0,             // max uploaded image width allowed, or 0 to ignore
    'max_img_height'      => 0,             // max uploaded image height allowed, or 0 to ignore
    'recursive'           => true,          // allow using subdirectories
    'allow_modify_subdirectories' => true,  // allow renaming/deleting subdirectories
    'allow_create_subdirectories' => true,  // allow creating subdirectories
    'forbid_extensions'   => array('php'),  // disallow uploading files with specified extensions
    'forbid_extensions_strict' => true,     // disallow specified extensions in the middle of the filename
  ),
  SPAW_CFG_TRANSFER_SECURE
);

// directories
SpawConfig::setStaticConfigItem(
  'PG_SPAWFM_DIRECTORIES',
  array(
    array(
      'dir'     => SPIcfg::$util['spaw2']['pubsite_store'],
      'fsdir'   => SPIcfg::$util['spaw2']['store'],
      'caption' => 'Files', 
      'params'  => array(
        'default_dir' => true, // set directory as default (optional setting)
        'allowed_filetypes' => array('any')
      )
    ),
    /*
    array(
      'dir'     => SpawConfig::getStaticConfigValue('SPAW_DIR').'uploads/flash/',
      'caption' => 'Flash movies', 
      'params'  => array(
        'allowed_filetypes' => array('flash')
      )
    ),
    array(
      'dir'     => SpawConfig::getStaticConfigValue('SPAW_DIR').'uploads/images/',
      'caption' => 'Images',
      'params'  => array(
        'default_dir' => true, // set directory as default (optional setting)
        'allowed_filetypes' => array('images')
      )
    ),
    array(
      'dir'     => SpawConfig::getStaticConfigValue('SPAW_DIR').'uploads/files/',
      'fsdir'   => SpawConfig::getStaticConfigValue('SPAW_ROOT').'uploads/files/', // optional absolute physical filesystem path
      'caption' => 'Files', 
      'params'  => array(
        'allowed_filetypes' => array('any')
      )
    ),
    */
  ),
  SPAW_CFG_TRANSFER_SECURE
);

?>